package com.jj.mapper;

import com.jj.entity.Employees;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 86137
* @description 针对表【employees(员工基本信息表)】的数据库操作Mapper
* @createDate 2025-05-30 08:41:50
* @Entity com.jj.entity.Employees
*/
@Mapper
public interface EmployeesMapper {
    //查询所有员工人数
    Employees selectAllCount();
    //根据员工工号查询员工信息
    List<Employees> selectEmployeeByEmployeeNo(@Param("employeeNo") String employeeNo);
    //根据员工姓名和所属部门ID查询员工信息
    List<Employees> selectEmployeeByNameAndDepartmentId(@Param("name") String name, @Param("departmentId") Integer departmentId);
    //查询所有员工考勤的次数（按次数倒序排列），只要返回员工工号、员工姓名、员工考勤次数
    List<Employees> selectAllEmployeeAttendanceCount();
    //删除离职员工的考勤记录
    int deleteByStatus(@Param("status") Integer status);
    //根据员工工号查询员工信息 (包括该员工的考勤记录)
    Employees selectEmployeeByEmployeeNoWithAttendance(@Param("employeeNo") String employeeNo);
    //新建员工
    int addEmployee(@Param("employee") Employees employee);
}
